package com.dsjy.yf.address.utils;

import org.springframework.stereotype.Component;

/**
 * @author whj
 * @version 1.0
 * @date 2021-01-18 11:09
 */
public class MyStringUtil {
    public String toCountyCode(Integer code){
        return String.valueOf(code).substring(0,6);
    }


    public static String removeEmpty(String value) {
        return value == null ? null : value.trim();
    }

    public static String emptyToNull(String value) {
        if (value == null) {
            return null;
        }
        value = value.trim();
        return value.length() == 0 ? null : value;
    }

    public static String removeSign(String value) {
        if (value == null) {
            return null;
        } else {
            value = value.replaceAll("\"", "").trim();
            return value.length() == 0 ? null : value;
        }
    }
}
